<?php

namespace api\user\controller;

class AdminValidateController extends \Aaa\AdminController {

    protected function init() {
        $this->baseField = [
            [
                'field' => 'id',
                'name' => 'ID',
            ],
            [
                'field' => 'user_id',
                'name' => '用户',
            ],
            [
                'field' => 'type',
                'name' => '认证类型',
                'type' => 'select',
                'options' => [
                    ['name' => '人脸实名认证（旗舰版）', 'value' => 'baiduIdentify'],
                    ['name' => '银行卡认证', 'value' => 'vbank'],
                ],
            ],
            [
                'field' => 'create_time',
                'name' => '认证时间',
                'type' => 'time',
            ],
            [
                'field' => 'name',
                'name' => '姓名',
            ],
            [
                'field' => 'id_card',
                'name' => '身份证',
            ],
            [
                'field' => 'gender',
                'name' => '性别',
            ],
            [
                'field' => 'nation',
                'name' => '民族',
            ],
            [
                'field' => 'birthday',
                'name' => '生日',
            ],
            [
                'field' => 'address',
                'name' => '地址',
            ],[
                'field' => 'issue_authority',
                'name' => '签发机关',
            ],[
                'field' => 'issue_time',
                'name' => '有效期限-起',
            ],
            [
                'field' => 'expire_time',
                'name' => '有效期限-止',
            ],
            [
                'field' => 'face_image',
                'name' => '人脸照片',
                'type' => 'image',
            ],
            [
                'field' => 'id_card_front_image',
                'name' => '身份证正面',
                'type' => 'image',
            ],
            [
                'field' => 'id_card_back_image',
                'name' => '身份证反面',
                'type' => 'image',
            ],
            [
                'field' => 'bank_card',
                'name' => '银行卡',
            ],
            [
                'field' => 'mobile',
                'name' => '手机',
            ],
        ];
    }

    protected function beforeIndex() {
        $this->searchField = [
            'common' => [
                'id' => 'accurate',
                'user_id' => 'accurate',
                'type' => 'accurate',
                'name' => 'accurate',
                'id_card' => 'accurate',
                'mobile' => 'accurate',
                'gender' => 'accurate',
                'nation' => 'accurate',
                'birthday' => 'accurate',
                'address' => 'fuzzy',
                'issue_authority' => 'fuzzy',
                'issue_time' => 'accurate',
                'expire_time' => 'accurate',
            ],
            'time' => ['create_time'],
        ];
    }

}